package imaa.escola.turma.repository;

import imaa.escola.turma.domain.Turma;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface TurmaRepository extends JpaRepository<Turma, Long>, TurmaRepositoryCustom {

	@Query("SELECT a FROM Turma a WHERE LOWER(DSC_TURMA) LIKE CONCAT('%', LOWER(:descricao), '%')")
    public List<Turma> findByName(@Param("descricao") String descricao);
}
